package com.just.spring4.ch3.condition;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Conditional 注解根据满足某一个特定条件创建一个特定的bean。
 */
public class ConditionMain {
    public static void main(String[] args){
        AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext(ConditionConfig.class);
        ListService listService=context.getBean(ListService.class);
        System.out.println(context.getEnvironment().getProperty("os.name")+"系统下的列表命令为："+listService.showListCmd());
    }
}
